import { addShopDecoration, getShopDecoration } from '@/services/ShopDecoration'
import { useState } from 'react'

export default () => {
  const [shopData, setShopData] = useState<any>([]) // 商品数据
  const [shopUpdateData, setShopUpdateData] = useState<any>({}) // 更新商品数据
  const [currentTab, setCurrentTab] = useState<any>({
    label: 'mp-alipay',
    name: '支付宝'
  }) // 当前tab
  const [currentSelectCom, setCurrentSelectCom] = useState<any>(['navigationArr', 'bannerArr']) // 当前选中组件

  const AddShopDecoration = (data: any) => {
    return addShopDecoration(data)
  }

  const GetShopDecoration = (params: any) => {
    return getShopDecoration(params)
  }

  return {
    AddShopDecoration,
    GetShopDecoration,

    shopData,
    setShopData,

    setShopUpdateData,
    shopUpdateData,

    setCurrentTab,
    currentTab,

    setCurrentSelectCom,
    currentSelectCom
  }
}
